from flask import Flask, redirect, url_for

from blueprint import blueprint_register
from restful import restful_register
from restful.model import db
from restful.response import UnifiedApi


app = Flask(__name__)
blueprint_register(app)

app.secret_key = '11111111111'

app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:///bs.db'
db.init_app(app)
with app.app_context():
    db.create_all()

api=UnifiedApi(app)
restful_register(api)




@app.route('/')
def hello_world():  # put application's code here
    return redirect(url_for('page.login'))


if __name__ == '__main__':
    app.run()
